Properties

$business

$business

$displayname

$displayname

$surname

$surname

$firstname

$firstname

$middlename

$middlename

$nickname

$nickname

$organization

$organization

$email

$email

$eol

$eol

$values_decoded

$values_decoded

$raw

$raw

$fieldmap

$fieldmap

$typemap

$typemap

$phonetypemap

$phonetypemap

$addresstypemap

$addresstypemap

$immap

$immap

Methods

__construct()

__construct(string  $vcard = null, string  $charset = RCUBE_CHARSET, bool  $detect = false, array  $fieldmap = []) : mixed

Constructor

Parameters

string $vcard

vCard content

string $charset

Charset of string values

bool $detect

True if loading a 'foreign' vcard and extra heuristics for charset detection is required

array $fieldmap

Fields mapping definition

Returns

mixed —

load()

load(string  $vcard, string  $charset = RCUBE_CHARSET, bool  $detect = false) : mixed

Load record from (internal, unfolded) vcard 3.0 format

Parameters

string $vcard

vCard string to parse

string $charset

Charset of string values

bool $detect

True if loading a 'foreign' vcard and extra heuristics for charset detection is required

Returns

mixed —

get_assoc()

get_assoc() : array

Return vCard data as associative array to be used in Roundcube address books

Returns

array —

Hash array with key-value pairs

export()

export(mixed  $folded = true) : string

Convert the data structure into a vcard 3.0 string

Parameters

mixed $folded

Returns

string —

vCard output

reset()

reset(mixed  $fields = []) : mixed

Clear the given fields in the loaded vcard data

Parameters

mixed $fields

Returns

mixed —

set()

set(string  $field, mixed  $value, string  $type = 'HOME') : mixed

Setter for address record fields

Parameters

string $field

Field name

mixed $value

Field value

string $type

Type/section name

Returns

mixed —

set_raw()

set_raw(string  $tag, array  $value, bool  $append = false) : mixed

Setter for individual vcard properties

Parameters

string $tag

VCard tag name

array $value

Value-set of this vcard property

bool $append

Set to true if the value-set should be appended instead of replacing any existing value-set

Returns

mixed —

extend_fieldmap()

extend_fieldmap(array  $map) : mixed

Extends fieldmap definition

Parameters

array $map

Field mapping definition

Returns

mixed —

import()

import(string  $data) : \rcube_vcard[]

Factory method to import a vcard file

Parameters

string $data

vCard file content

Returns

\rcube_vcard[] —

List of rcube_vcard objects

cleanup()

cleanup(string  $vcard) : string

Normalize vcard data for better parsing

Parameters

string $vcard

vCard block

Returns

string —

Cleaned vcard block

rfc2425_fold()

rfc2425_fold(string  $val) : string

Apply RFC2425 folding to a vCard content

Parameters

string $val

vCard content

Returns

string —

Folded vCard string

vcard_encode()

vcard_encode(array  $data) : string

Encodes an entry for storage in our database (vcard 3.0 format, unfolded)

Parameters

array $data

Raw data structure to encode

Returns

string —

vCard encoded string

vcard_quote()

vcard_quote(array  $str, string  $sep = ';') : string

Join indexed data array to a vcard quoted string

Parameters

array $str

Field data

string $sep

Separator

Returns

string —

Joined and quoted string

get_type_index()

get_type_index(string  $field) : int

Find index with the '$type' attribute

Parameters

string $field

Field name

Returns

int —

Field index having $type set

charset_convert()

charset_convert(mixed  $card, mixed  $force_charset = null) : mixed

Convert a whole vcard (array) to UTF-8.

If $force_charset is null, each member value that has a charset parameter will be converted

Parameters

mixed $card
mixed $force_charset

Returns

mixed —

x_abrelatednames_callback()

x_abrelatednames_callback(array  $matches) : string

Apple X-ABRELATEDNAMES converter callback

Parameters

array $matches

Matching entries

Returns

string —

Replacement string

rfc2425_fold_callback()

rfc2425_fold_callback(array  $matches) : string

RFC2425 folding callback

Parameters

array $matches

Matching entries

Returns

string —

Replacement string

vcard_decode()

vcard_decode(string  $vcard) : array

Decodes a vcard block (vcard 3.0 format, unfolded) into an array structure

Parameters

string $vcard

vCard block to parse

Returns

array —

Raw data structure

decode_value()

decode_value(string  $value, string  $encoding) : string

Decode a given string with the encoding rule from ENCODING attributes

Parameters

string $value

String to decode

string $encoding

Encoding type (quoted-printable and base64 supported)

Returns

string —

Decoded 8bit value

vcard_unquote()

vcard_unquote(string  $str, string  $sep = ';') : string|array

Split quoted string

Parameters

string $str

vCard string to split

string $sep

Separator char/string

Returns

string|array —

Unquoted string or a list of strings if $sep was found

is_empty()

is_empty(string|array  $value) : bool

Check if vCard entry is empty: empty string or an array with all entries empty.

Parameters

string|array $value

Attribute value

Returns

bool —

True if the value is empty, False otherwise

detect_encoding()

detect_encoding(string  $string) : string

Returns UNICODE type based on BOM (Byte Order Mark)

Parameters

string $string

Input string to test

Returns

string —

Detected encoding